import { NodeRoot } from "../Base/NodeRoot";
import { NMNode } from "../Base/NodeGraph";
@NMNode
export class ScaleTime extends NodeRoot{
    public Node: any;
    public StartScale;
    public EndScale;
    public Time:number;
    private setNode:cc.Node;
    private completed=false;
    onEnter(){
        this.setNode=this.Node;
        if(!this.setNode){
            this.setNode=this.ownerNode;
        }
        this.setNode.setScale(cc.v2(this.StartScale.x,this.StartScale.y));
        this.setNode.runAction(cc.sequence([
            cc.scaleTo(this.Time,this.EndScale.x,this.EndScale.y),
            cc.callFunc(()=>this.completed=true,this)
        ]));
        console.log("缩放渐变",this,this.StartScale,this.EndScale);
    }
    onStep(dt){
        return this.completed;
    }
}